import { _decorator, Component, Node, loader, url } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('Main')
export class Main extends Component {

    start() {
        this.loadJson();
    }
    private loadJson(): void {
        let path: string = url.raw("resources/zip/config.zip");
        loader.load({ url: path, type: "binary", }, (err, res) => {
            if (err) return;
            JSZip.loadAsync(res).then((zip: JSZip) => {
                console.log(zip.files)
                zip.file("config.json").async("text").then((data: string) => {
                    console.log(JSON.parse(data));
                })
            })
        });
    }
    update(deltaTime: number) {

    }
}
